<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>LT8900 Arduino Library: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">LT8900 Arduino Library
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">LT8900 Arduino Library Documentation</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Rob van der Veer, may 2015.</p>
<p>This is driver library for use with the low cost <a class="el" href="class_l_t8900.html">LT8900</a> and LT8910 2.4Ghz transceiver modules as found on ebay.</p>
<p>This library was written because I could not found one, and the chips are incompatible with the NRF24L01(+) modules, even though they look very similar.</p>
<h3>Installation</h3>
<p>To install, get the .ZIP from here:</p>
<p>[<a href="https://bitbucket.org/robvanderveer/lt8900lib/downloads">https://bitbucket.org/robvanderveer/lt8900lib/downloads</a>]()</p>
<p>When downloaded, rename the zip to <code>LT8900.zip</code> and use the Arduino IDE to install the library.</p>
<h3>Class documentation</h3>
<p>The folder /doc contains generated html documentation.</p>
<h3>Connections</h3>
<blockquote class="doxtable">
<p>modules are 3.3v maximum! Use a 3.3v Arduino or provide sufficient level shifting (e.g. via 74HC4050) </p>
</blockquote>
<p>Pinout of the module looks like NRF24L01 but they are different. Below is a diagram to illustrate:</p>
<table class="doxtable">
<tr>
<th>1 </th><th>2  </th></tr>
<tr>
<td>3 </td><td>4 </td></tr>
<tr>
<td>5 </td><td>6 </td></tr>
<tr>
<td>7 </td><td>8 </td></tr>
</table>
<table class="doxtable">
<tr>
<th>IN </th><th><a class="el" href="class_l_t8900.html">LT8900</a> </th><th>NRF24L01  </th></tr>
<tr>
<td>1 </td><td>PKT </td><td>IRQ </td></tr>
<tr>
<td>2 </td><td>MISO </td><td>MISO </td></tr>
<tr>
<td>3 </td><td>MOSI </td><td>MOSI </td></tr>
<tr>
<td>4 </td><td>SCK </td><td>SCK </td></tr>
<tr>
<td>5 </td><td>RESET </td><td><b>SS</b> </td></tr>
<tr>
<td>6 </td><td><b>SS</b> </td><td>CE </td></tr>
<tr>
<td>7 </td><td>VCC </td><td>VCC </td></tr>
<tr>
<td>8 </td><td>GND </td><td>GND </td></tr>
</table>
<p>On the <a class="el" href="class_l_t8900.html">LT8900</a>, pin 5 should not be connected, because that one is tied to the LDO out of the module.</p>
<h3>Simplyduino compatibility</h3>
<p>Simplyduino is a custom board I developed especially for hosting these 2.4Ghz modules. All information can be found on the project site <a href="http://simplicate.info/simplyduino">here</a>.</p>
<p>The pinouts are compatible but there is a caviat. On the simplyduino pin 5 of the 2x4 header is connected to the Slave Select #10 pin of the AtMega. The Arduino SPI.h always uses this pin as an OUTPUT pin, and automatically sets it to <code>HIGH</code>. The <a class="el" href="class_l_t8900.html">LT8900</a> module uses this very pin as a RESET pin. Pretty handy, if you are aware.</p>
<blockquote class="doxtable">
<p>One of my <a class="el" href="class_l_t8900.html">LT8900</a> boards came with a bad connection, shorting the RESET pin with the VDD pin on the CPU which caused all sorts of drama. </p>
</blockquote>
<p>On other boards, just leave the pin disconnected.</p>
<h3>Module workings</h3>
<p>These <a class="el" href="class_l_t8900.html">LT8900</a> networking chips are a little simpler than the NRF. They don't have <em>shockburst</em> or <em>pipes</em> or any of that fancy stuff.</p>
<p>When you send a packets, the packet assembler adds leaders and trailers and CRC checks etc. One of the things that is added to a package is a <em>SyncWord</em>. A module that is listening for incoming data will only read the payload when the syncword matches. So basically, you can create multiple pipes manually by setting the syncword before a <a class="el" href="class_l_t8900.html#a2231aaa6fdc220f405286f0f6b169988">LT8900::sendPacket</a>, and sertting the same syncword on the receiver side just before the <a class="el" href="class_l_t8900.html#a6152869b35b9bc89e75cd7b0556f49a9">LT8900::startListening</a> call. This can come in handy when you want to do a send/reply protocol with multiple nodes.</p>
<blockquote class="doxtable">
<p>This is in contrast with the NRF24L01 which can listen to multiple (5) pipes at the same time. </p>
</blockquote>
<blockquote class="doxtable">
<p>Note that if you are switching syncwords, you will not be able to receive other packets. The will not be queued. </p>
</blockquote>
<p>The <a class="el" href="class_l_t8900.html">LT8900</a> is very open with respect to packet sizes. Because of the packet length byte, odd packet sizes are preferred (1,3,5,7, etc). The fifo can handle packets up to 64 bytes.</p>
<h3>Sending data</h3>
<p>To send a packet, simply call <a class="el" href="class_l_t8900.html#a2231aaa6fdc220f405286f0f6b169988">LT8900::sendPacket</a>.</p>
<h3>Receiving data</h3>
<p>Reading and sending states are mutually exclusive.</p>
<p>To start receiving data, put out a call to <a class="el" href="class_l_t8900.html#a6152869b35b9bc89e75cd7b0556f49a9">LT8900::startListening</a> and regularly poll the <a class="el" href="class_l_t8900.html#a628b08e73e27d95b37125dbf6b25dadc">LT8900::available</a> method. If you are fancy, you could add an interrupt to the PKT_flag pin (which does basically the same). When a packet is waiting (<a class="el" href="class_l_t8900.html#a628b08e73e27d95b37125dbf6b25dadc">LT8900::available</a> = true), call <a class="el" href="class_l_t8900.html#aa72b08b3ac271ed18a660004a460a688">LT8900::read</a> to retrieve the data from the FIFO queue. To receive the next payload, you must call <a class="el" href="class_l_t8900.html#a6152869b35b9bc89e75cd7b0556f49a9">LT8900::startListening()</a> again.</p>
<h3>RSSI scanning</h3>
<p>Retrieve the signal strength of one or more channels by calling <a class="el" href="class_l_t8900.html#a1e8e1ad5bd96aedf8264cf9b8e40dd7f">LT8900::scanRSSI()</a>. While the module can scan 128 channels (7 bits) only 6 bits are available for the number of consequetive channels so when you want to scan all channels you will have to do it it batches. The reason for this is the size of the FIFO queue that can only handle 64 bytes maximum.</p>
<p>Use <a class="el" href="class_l_t8900.html#a5eceda7c4393a253e2a406c3e2ac982e">LT8900::getRSSI()</a> to retrieve the signal strength for the active channel.</p>
<h3>Examples</h3>
<ul>
<li>the example <code>lt8900test</code> shows the basic usage.</li>
<li>the second sample <code>scanner</code> shows the activity on the Wifi Channels. </li>
</ul>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
